package com.cykj.user.controller;

import com.cykj.common.dto.ResponseDTO;
import com.cykj.user.service.IBlackService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @BelongsProject: smart_recruit_backend
 * @BelongsPackage: com.cykj.user.controller
 * @Author: 浮行
 * @CreateTime: 2025-08-26 06:40
 * @Description: TODO
 * @Version: 1.0
 */
@RestController
@RequestMapping("/black")
public class BlackController {
    @Autowired
    private IBlackService blackService;
    @GetMapping("/select")
    @Operation(summary = "通过用户Id获取拉黑职位信息")
    @Parameters({
            @Parameter(name = "userId",description = "用户id",required = true,in = ParameterIn.QUERY)
    })
    public ResponseDTO select(@RequestParam("userId") Integer userId){
        return blackService.selectBlackList(userId);
    }
    @DeleteMapping("/delete/{blackListId}")
    @Operation(summary = "通过黑名单列表id删除对应的拉黑")
    @Parameters({
            @Parameter(name = "blackListId",description = "黑名单列表id",required = true,in = ParameterIn.QUERY)
    })
    public ResponseDTO delete(@PathVariable("blackListId") Integer blackListId){
        return blackService.deleteBlack(blackListId);
    }
}
